import { Element } from "components/Three";
import { IObject3DMap } from "components/Three/interface/IElement";

export default function threeToMap(elementMap: Map<string, Element<keyof IObject3DMap, any>>, e?: string) {
    if (!e) return undefined;
    const list = [...elementMap.values()];
    for (let i = 0; i < list.length; i++) {
        const object3D = list[i].getObject3D();
        if (object3D?.uuid === e) {
            return list[i].uuid;
        }
    }
}